package com.yaorange.service.impl;

import com.yaorange.dao.HouseMapper;
import com.yaorange.entity.House;
import com.yaorange.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class HouseServiceImpl implements HouseService {

    @Autowired
    private HouseMapper houseMapper;


    @Override
    public int update(House house) {
        return houseMapper.updateByPrimaryKeySelective(house);
    }

    @Override
    public int addHouse(House house) {
        return houseMapper.insertUseGeneratedKeys(house);
    }

    @Override
    public int delete(Integer houseId) {
        return houseMapper.deleteByPrimaryKey(houseId);
    }


}
